Mark Notification Read
You can use the following function from the LikeMinds iOS SDK to mark the notifications that have been clicked by user in your application, as read.
Steps to mark a notification as read
- Create a MarkReadNotificationRequest object using
MarkReadNotificationRequest.builder()
class by passing all the required parameters. - Call
markReadNotification()
function using the instance ofLMFeedClient
. - Process the response LMResponse<NoData> as per your requirement.
// object of MarkReadNotificationRequest
let request = MarkReadNotificationRequest.builder()
.activityId("64824ce1167fe6ac068ad444") // id of the notification activity which is to be marked as read
.build()
LMFeedClient.shared.markReadNotification(request) { response in
// response (LMResponse<NoData>)
if (response.success) {
// your function to process the response data
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}
MarkReadNotificationRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
activityId | String | ID of the notification activity which is to be marked as read. |